/*
	File:		UpgradeState.h
	Author:		Ben Feldmann
	Purpose:	state for managing the upgrade/crafting menu
*/

#pragma once

#include "IGameState.h"

#include "MeleeWeapon.h"
#include "RangedWeapon.h"

class Player;


struct items
{
	MeleeWeapon* melee;
	RangedWeapon* ranged;
	int skill;

	int position;
	bool purchased;

	int priceCircuit;
	int priceMetal;

	int x;
	int y;

};


class UpgradeState : public IGameState
{
public:
	static UpgradeState* GetInstance();
		
	void Enter();

	void Exit();

	bool Input();

	void Update(float elapsed);

	void Render();

	bool GetExit() const	{return exit;}

	void InitItems();

	void SetPlayer(int index, Player* tmp)	{playerIndex = index; player = tmp;}

	bool IsFirstTime()	{return firstTime;}

	TCHAR circuitStr	[20];
	TCHAR metalStr		[20];
	TCHAR curEqStr		[25];
	TCHAR meleeStr		[15];
	TCHAR rangedStr		[20];
	TCHAR skillsStr		[30];
	TCHAR equipStr		[25];
	TCHAR exitStr		[10];
	TCHAR purchaseStr	[10];
	TCHAR assignStr		[30];

	// Description Strings //

	/* Dutch */
	TCHAR nlFistStr		[200];
	TCHAR nlSwordStr	[200];
	TCHAR nlSawStr		[200];
	TCHAR nlClawStr		[200];
	TCHAR nlGunStr		[200];
	TCHAR nlRockStr		[200];
	TCHAR nlEMPStr		[225];
	TCHAR nlFlameStr	[230];
	TCHAR nlCamoStr		[200];
	TCHAR nlClockStr	[200];
	TCHAR nlShieldStr	[200];
	TCHAR nlAttrStr		[200];

	/* English */
	TCHAR enFistStr		[175];
	TCHAR enSwordStr	[175];
	TCHAR enSawStr		[175];
	TCHAR enClawStr		[180];
	TCHAR enGunStr		[175];
	TCHAR enRockStr		[175];
	TCHAR enEMPStr		[210];
	TCHAR enFlameStr	[225];
	TCHAR enCamoStr		[175];
	TCHAR enClockStr	[175];
	TCHAR enShieldStr	[175];
	TCHAR enAttrStr		[175];

	int GetButtonA() const	{return buttonA;}

private:

	UpgradeState(void);
	~UpgradeState(void);
	UpgradeState(const UpgradeState& other);
	UpgradeState& operator=(const UpgradeState& other);

	items toBuy[2][3][4];

	int curPos;

	// Assets
	int backgroundID;
	int hudIcons;
	int textBox;
	int surroundBox;
	int curEquipped;
	int buttonA;
	int buttonY;
	int buttonB;
	int leftBump;
	int rightBump;

	bool exit;

	// Currently equpped weapons
	bool fistEquip;
	bool swordEquip;
	bool sawEquip;
	bool clawEquip;

	bool gunEquip;
	bool rocketEquip;
	bool empEquip;
	bool flameEquip;

	bool camoEquip;
	bool clockEquip;
	bool shieldEquip;
	bool attrEquip;

	int weaponOneType;
	int weaponTwoType;
	int skillOneType;
	int skillTwoType;
	int prevSkillOne;
	int prevSkillTwo;

	// Prices
	int attrMetal;
	int attrCircuit;
	int camoMetal;
	int clockMetal;
	int shieldMetal;
	int camoCircuit; 
	int clockCircuit; 
	int shieldCircuit;

	int playerIndex;
	Player* player;
	
	bool firstTime;

	int purchased[10];

	bool entering;
};

